﻿<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title>上传产品</title>
		<link href="{:_SKIN}/weixin/xieyi/css/style.css" rel="stylesheet" type="text/css">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="format-detection" content="telephone=no, email=no" />
		 {:jq()}
		 {:layui()}
		 <style>
         .half { width: 33.3% }
		 </style>
		 
	</head>

	<body>
		<header>
			<a href="javascript:history.go(-1)"><img src="{:_SKIN}/weixin/xieyi/picture/rpw_back_n.png" /></a>
			<span>填写企业信息</span>
			<div class="clear"></div>
		</header>
		<section class="logo-license">
			<div class="half">
				<a class="logo" id="sfz" >
					<img id="bgl" class="sfz" src="{:_SKIN}/weixin/xieyi/picture/logo_n.png" />

				</a>
				
				<p>产品图片</p>
			</div>
			

			
			<div class="clear"></div>
		</section>

		

		<article class="info">
		<form id="bd1">
		<input type="hidden" value="" name="yyzz" id="yyzzpic" class="btx">
		<input type="hidden" value="" name="sfz" id="sfzpic"   class="btx">
		<input type="hidden" value="" name="qt" id="qtpic">
			<ul>
				<li>
					<div class="left">
						产品名称:
					</div>
					<div class="right">
						<input placeholder="请输入产品名称" name="qymc" class="btx">
					</div>
					<div class="clear"></div>
				</li>
				
				<li>
					<div class="left">
						产品价格:
					</div>
					<div class="right" >
						<input placeholder="请输入产品价格" name="qyfr" class="btx">
					</div>
					<div class="clear"></div>
				</li>


				<li>
					<div class="left">
						产品分类:
					</div>
					<div class="right" >
						<input placeholder="请输入产品分类" name="qyfr" class="btx">
					</div>
					<div class="clear"></div>
				</li>


				


				
				
                  
				
				
				 

				  

				
				
			</ul>
			</form>
		</article>
		<article class="btn-1">
			<button type="button" onclick="sub()">确认提交</button>
		</article>

		<script type="text/javascript">
		layui.upload.render({
        elem: '#yyzz'
        ,url: "{:url('api/upload/qiniu')}"
        ,size: 500000 //限制文件大小，单位 KB
        ,before:function(){

           layer.msg('上传中', {
			  icon: 16
			  ,shade: 0.3
			  ,time:5000
			});

        }
        ,done: function(res){
        	
        	if(res.code==200){
        	 layer.msg('上传成功');


             $("#yyzzpic").val(res.url);
             $(".yyzz").attr('src',res.url);



        	}
           
        }
    });


		layui.upload.render({
        elem: '#qt'
        ,url: "{:url('api/upload/qiniu')}"
        ,size: 500000 //限制文件大小，单位 KB
        ,before:function(){

           layer.msg('上传中', {
			  icon: 16
			  ,shade: 0.3
			  ,time:5000
			});

        }
        ,done: function(res){
        	
        	if(res.code==200){
        	 layer.msg('上传成功');


             $("#qtpic").val(res.url);
             $(".qt").attr('src',res.url);



        	}
           
        }
    });


    layui.upload.render({
        elem: '#sfz'
        ,url: "{:url('api/upload/qiniu')}"
        ,size: 500000 //限制文件大小，单位 KB
        ,before:function(){

           layer.msg('上传中', {
			  icon: 16
			  ,shade: 0.3
			  ,time:5000
			});

        }
        ,done: function(res){
        	
        	if(res.code==200){
        	


             $("#sfzpic").val(res.url);
             $(".sfz").attr('src',res.url);

             

        	}
           
        }
    });	


     function sub(){
    
     var num=$(".btx").length;


    for(var i=0;i<num;i++){

      if(!$(".btx").eq(i).val()){
         
       
       alert('请把资料填写完整');
       return false;

      }
      

    }

     

    
     var data=$("#bd1").serialize();


     $.post(' ',data,function(res){

         if(res.code==200){

          alert('提交成功，请等待客服完成审核');
          window.location.href="{:url('index')}";

       }else{

         alert(res.msg);

      }

     });

     }

		</script>
		
	
		<!--行业选择结束-->
		
		
	</body>

</html>